//
//  YKRecommendCategoryCell.m
//  baisi
//
//  Created by 吴高烽 on 16/9/3.
//  Copyright © 2016年 吴高烽. All rights reserved.
//

#import "YKRecommendCategoryCell.h"
@interface YKRecommendCategoryCell()
@property (weak, nonatomic) IBOutlet UIView *selectedIndicator;

@end
@implementation YKRecommendCategoryCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.backgroundColor = YKRGBColor(244, 244, 244);
    self.selectedIndicator.backgroundColor = YKRGBColor(219, 21, 26);
}
/**
 *  监听cell的选中和非选中状态
 */
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    self.selectedIndicator.hidden = !selected;
    self.textLabel.textColor = selected ? self.selectedIndicator.backgroundColor : YKRGBColor(78, 78, 78);
    self.backgroundColor = selected ? [UIColor whiteColor] : YKGlobalBackgroundColor ;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.textLabel.y = 1;
    self.textLabel.height = self.contentView.height - 2*self.textLabel.y ;
}
-(void)setCategory:(YKRecommendCategory *)category{
    _category = category ;
    self.textLabel.text = category.name ;
}
@end
